﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Entity
{
    public class StepRequest
    {
        public string UserID { get; set; }
        public string Opponent { get; set; }
        public bool FirstPlayer { get; set; } //ha igaz akkor az első játékos, ha hamis akkor a második
        public Point StepFrom { get; set; }
        public Point StepTo { get; set; }
        public String TableID { get; set; }

        public StepBIRequest FromDto()
        {
            StepBIRequest request = new StepBIRequest();
            request.StepFrom = StepFrom;
            request.StepTo = StepTo;
            request.UserID = UserID;
            request.FirstPlayer = FirstPlayer;
            request.TableID = TableID;
            request.Opponent = Opponent;
            return request;
        }

        public List<string> Log()
        {
            List<string> result = new List<string>();
            result.Add("Method: Step - Request");
            result.Add("Request by: " + UserID);
            result.Add("Player: " + (FirstPlayer ? "Red" : "Green"));
            result.Add("Step from: " + StepFrom.X + StepFrom.Y);
            result.Add("Step to: " + StepTo.X + StepTo.Y);
            result.Add("Table ID: " + TableID);
            return result;
        }
    }
}
